/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 combat_object_fader.h

	$Header: /heroes4/combat_object_fader.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( COMBAT_OBJECT_FADER_H_INCLUDED )
#define COMBAT_OBJECT_FADER_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "combat_object_ptr.h"
#include "counted_animation.h"
#include "counted_idle_processor.h"
#include "handler.h"

// ----------------------------------------------------------------------
// class to fade creature image in or out
// ----------------------------------------------------------------------
class t_combat_object_fader : public t_counted_idle_processor, public t_counted_animation
{
public:
	t_combat_object_fader(  t_battlefield& battlefield,
							t_abstract_combat_object* object, bool fade_in );

	virtual void on_idle();
	void         set_end_handler( t_handler handler );
protected:
	t_combat_object_ptr m_object;
	bool                m_fading_in;
	t_handler			m_handler;
};

inline void t_combat_object_fader::set_end_handler( t_handler handler )
{
	m_handler = handler;
}

typedef t_counted_ptr< t_combat_object_fader > t_combat_object_fader_ptr;

#endif // COMBAT_OBJECT_FADER_H_INCLUDED